Running Models Using the Command Line

You can run a model from outside of Stella using command line options. For example, on Windows, to open a model called "test.itmx", run it, and then exit from Stella, you would use the following form of command line prompt:

"Stella Professional.exe" -r test.itmx

On a Macintosh, the equivalent command, running from a terminal, would be:

open -a "Stella Professional.app" test.itmx --args -r

On windows, you'll need to either have Stella in your path, or specify the complete location of the .exe file. On a Macintosh, you'll need to specify the location of the application bundle (which appears in Finder without the .app extension), if you have more than one copy of the software installed.

The following table lists the available command line options.

Option Description
-r Run the model "ballistically" (as quickly as possible, with the simulation speed set to 0, and any pause interval ignored) and then quit without saving.
-rn N Run the model "ballistically" N times and then quit without saving. (N > 0)
-ro Run optimization as defined in the model and then quit without saving.
-rs Run sensitivity analysis as defined in the model and then quit without saving.
-rd Restore all devices after opening the model (before the first run).
-s Save the model at the end of the last run.
-i Import Now before each run.
-x Export Now after each run.
-nq Do not quit after the last run.
-0 var Force the value of the specified variable (variable) to 0 (zero) after opening the model (before the first run).
-1 var Force the value of the specified variable (variable) to 1 after opening the model (before the first run).

Tip: To run comparative runs for difference scenarios, use the -0 and -1 options to set the proper configuration switches, and use the -s option to save after the run.

Tip: On a Macintosh, don't pass a number as the final argument, as this will generate an error message (though the commands will still be processed). So instead of "-r -rn 20", use "-rn 20 -r", and no error message will appear.

Note: If the command generates an error (for example, specifying -rs when no sensitivity has been set up) the software will not close independent of the -nq option.

Concept Link IconSee Also